Repository navigation
fix,ci: P0 runtime safety fixes and CI/CD hardening - #73
Merged
Merged
Conversation
- Other/fee_adjuster.py: replace append-mode fee_adjuster.txt writes with atomic 0o644 replacement, exit non-zero on fatal errors instead of sleeping 60s, and add DEFAULT_HTTP_TIMEOUT=30.
- LNBits/pocketmoney.py: add DEFAULT_HTTP_TIMEOUT=30, gate success alerts/balance checks on successful pay_invoice() result, and exit 1 in --run-once mode on payment failures.
- Magma/magma_sale_process.py: read [loop] rpcserver/tlscertpath and expand ~ in tlscertpath before Popen.
- Peerswap/peerswap-lndg_push.py: guard locale.setlocale errors, use safe config.get fallbacks, add timeouts, and parse CLI args before invoking lncli/pscli.
- LNDg/channel_fee-pull.py & Peerswap/peerswap-bot.py: make imports side-effect-safe with __main__ guards, safe config fallbacks, atomic 0_fee.txt write, normalized pscli path, and HTTP timeouts.
- LNDg/{channel_base-fee,disabled_fee-accelerator,mempool_rebalancer_trigger,swap_out-candidates}.py: add explicit HTTP timeouts.
- tests/test_p0_runtime_safety.py: add regression tests covering all P0 fixes (209/209 passing, 40.81% total coverage).
…ecurity CI - Add [project] metadata (requires-python >=3.11,<3.14), optional db/dev extras, ruff config, and coverage settings in pyproject.toml. - Pin minimum bounds in requirements-dev.txt and expand .gitignore for runtime flags/state/caches. - Add github-actions weekly updates to .github/dependabot.yml. - Add parallel lint (ruff + bash -n + shellcheck), pip-audit security job, weekly schedule, job timeouts, and 35% coverage gate in .github/workflows/tests.yml.
🛡️⚡ TunnelSentinel Code ReviewVerdict: Latest commit: Executive SummaryTargeted re-review of commit Verified Fixes & Edge-Case Checks
Empirical Test Results
RecommendationClean pass ( Review history
|
… peer snapshot - .github/workflows/tests.yml: set shell: bash and set -o pipefail on the Python 3.12 pytest | tee step so test or coverage failures cannot be masked by tee. - Other/fee_adjuster.py: collect charge-lnd stanzas for all processed peers regardless of whether an individual peer crossed fee_delta_threshold so unchanged peers are preserved in atomic fee_adjuster.txt writes. - tests/test_p0_runtime_safety.py: add regression test verifying unchanged peers remain in the atomic fee_adjuster.txt snapshot (210/210 passing, 42.51% coverage).
tunnelsentinel
Bot
dismissed
their stale review
November 26, 2026 21:27
Superseded by a clean TunnelSentinel review of commit 8827d49, the current head of this pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
PR 1 of the phased Lightning-Python-Tools optimization plan (P0 runtime safety fixes & CI/CD foundation ahead of the unified installer PR):
Other/fee_adjuster.py: atomically replacefee_adjuster.txt(0o644) instead of appending duplicate stanzas on every run; fail non-zero (SystemExit(1)) on fatal top-level errors instead of sleeping 60s and exiting 0; addDEFAULT_HTTP_TIMEOUT = 30.LNBits/pocketmoney.py: gate"Transferred..."logs/Telegram alerts andcheck_balance()onpay_invoice()succeeding; exit1in--run-oncemode on failures; addDEFAULT_HTTP_TIMEOUT = 30.Magma/magma_sale_process.py: read[loop]rpcserver/tlscertpathand expand~viaos.path.expanduserbeforesubprocess.Popen.Peerswap/peerswap-lndg_push.py: guardlocale.setlocaleagainstlocale.Error, use safeconfig.get(..., fallback=...)at import time, addDEFAULT_HTTP_TIMEOUT = 30, and runargparse.parse_args()before invokinglncli/pscli.LNDg/channel_fee-pull.py: make import side-effect-safe (main()+__main__), stripbase_fee_ignorepubkeys, atomically write0_fee.txt(0o644), and addDEFAULT_HTTP_TIMEOUT = 30.Peerswap/peerswap-bot.py: make import side-effect-safe (run_bot()+__main__), fixPATH_COMMANDdouble-slash (os.path.join/[paths] pscli_path), require non-emptyTELEGRAM_USER_ID, and addtimeout=15toget_node_alias.LNDg/{channel_base-fee,disabled_fee-accelerator,mempool_rebalancer_trigger,swap_out-candidates}.py: addDEFAULT_HTTP_TIMEOUT = 30torequestscalls.[project]metadata (requires-python = ">=3.11,<3.14"),[project.optional-dependencies](db,dev),[tool.ruff], and[tool.coverage.*]topyproject.toml.ruff/pip-audittorequirements-dev.txtand expand.gitignorefor.ruff_cache/,*.flag,*.pid,.lpt-state.json,.lpt-backups/..github/dependabot.ymlwithgithub-actionsweekly updates..github/workflows/tests.ymlwith parallellint(ruff+bash -n+shellcheck),security(pip-audit), weekly schedule,timeout-minutes: 10, and--cov-fail-under=35.Verification
.venv/bin/pytest tests/ -v --cov=LNDg --cov=Magma --cov=Other --cov=Peerswap --cov=LNBits --cov-report=term --cov-fail-under=35: 209 passed (40.81%total coverage)..venv/bin/python -m py_compileon all modified scripts andtests/test_p0_runtime_safety.py: passed.bash -n LNBits/install_pocketmoney_service.sh Other/install_fee_adjuster_service.sh: passed..venv/bin/python -m pip_audit:No known vulnerabilities found.greptile-guard), so this PR is verified via GitHub Actions CI + TunnelSentinel.